<?php

/**
 * This class is for online shop order process.
 * params order step
 * This is the children of controller.
 * PHP5 CMS Typolight
 * Copyright is 34n.sam@gmail.com
 */
 
/**
 * Initialize the system
 */
define('TL_MODE', 'FE');
require('system/initialize.php');


class BillingAddr extends Controller
{
	/**
	 * This is class construct function.
	 * @params null
	 * @Return null
	 */
	public function __construct()
	{
		parent::__construct();		
	}
	
	/**
	 * Page compile like the index page.
	 * @params null
	 * @Return null
	 */
	public function run()
	{
		$this->import('Database');
		
		$this->updateBillingAddr();
	}
	
	/**
	 * Update the billing address.
	 * @params null
	 * @Return null
	 */
	private function updateBillingAddr()
	{
		$objAddr = $this->Database->prepare("UPDATE tl_member SET `firstname`=?, `lastname`=?, `street`=?, `street_2`=?, `city`=?, `state`=?, `country`=?, `postal`=?, `phone`=?, `mobile`=? WHERE id=?")
								->execute($_POST['firstname'], $_POST['lastname'], $_POST['street_billing'], $_POST['street_2'], $_POST['city_billing'], $_POST['state_billing'], $_POST['country_billing'], $_POST['postal_billing'], $_POST['phone_billing'], $_POST['mobile_billing'], $_POST['uid']);
		print_r($objAddr);exit;
	}
}

if (isset($_POST['action']) && $_POST['action'])
{
	$billingAddr = new BillingAddr();
	$billingAddr->run();
}
?>